package com.twu.biblioteca;

public class Database {
    private Library library;

    public Database(Library library) {
        this.library = library;
        initializeDB();
    }

    private void initializeDB() {
        initializeBookDB();
        initializeMovieDB();
        initializeCustomerDB();
    }

    private void initializeCustomerDB() {

        Customer customer1 = new Customer("abhijeet","304abhijeet@gmail.com","87654321","321-8765","abcd1234");
        Customer customer2 = new Customer("vishwas","vd@gmail.com","87655678","321-8799","abcd4567");

        library.addCustomerToLibrary(customer1);
        library.addCustomerToLibrary(customer2);
    }

    private void initializeMovieDB() {

        Movie movie1 = new Movie("TITANIC","JAMES_CAMEROON","1995",8);
        Movie movie2 = new Movie("GODFATHER","SPEILSBERG","1988",9);
        Movie movie3 = new Movie("DARK_KNIGHT","NOLAN","2005",10);

        library.addMovieToLibrary(movie1);
        library.addMovieToLibrary(movie2);
        library.addMovieToLibrary(movie3);
    }

    private void initializeBookDB() {

        Book book1 = new Book(1,"ABC","PQR","2000");
        Book book2 = new Book(2,"XYZ","PR","2001");
        Book book3 = new Book(3,"ZZZ","QR","2002");

        library.addBookToLibrary(book1);
        library.addBookToLibrary(book2);
        library.addBookToLibrary(book3);
    }
}
